package com.binhthuan.catechist.client.grid;

import com.binhthuan.catechist.client.ECApplication;
import com.binhthuan.catechist.client.data.DateDS;
import com.binhthuan.catechist.shared.constant.Parameter;
import com.smartgwt.client.widgets.grid.ListGridField;

public class DateGrid extends AbstractGrid {

    public DateGrid(DateDS dataSource) {
        super(dataSource);
        setWrapCells(true);

        ListGridField idField = new ListGridField(Parameter.ID);
        idField.setHidden(true);
        idField.setCanHide(false);

        ListGridField dateField = new ListGridField(Parameter.DATE_OF_YEAR);
        dateField.setTitle(ECApplication.getConstants().date());
        dateField.setWidth(150);

        ListGridField liturgicalField = new ListGridField(Parameter.LITURGICAL_DATE);
        liturgicalField.setTitle(ECApplication.getConstants().liturgicalDate());

        setSortField(Parameter.DATE_OF_YEAR);
        setFields(idField, dateField, liturgicalField);
        setAutoFetchData(false);
    }
}
